<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <div th:replace="common/top">

    </div>
    <div id="Content">
        <div id="Catalog">
            <table>
                <tr>
                    <th align="center" colspan="2" th:text="'Order #'+${session.order?.orderId} + ' ' + ${session.order?.orderDate}">
                    </th>
                </tr>
                <tr>
                    <th colspan="2"><h2>支付细节</h2></th>
                </tr>
                <tr>
                    <td>支付方式:</td>
                    <td th:text="${session.order?.cardType}"></td>
                </tr>
                <tr>
                    <td>卡号:</td>
                    <td th:text="${session.order?.creditCard}"> * Fake number!</td>
                </tr>
                <tr>
                    <td>到期日 (MM/YYYY):</td>
                    <td th:text="${session.order?.expiryDate}"></td>
                </tr>
                <tr>
                    <th colspan="2"><h2>支付方信息</h2></th>
                </tr>
                <tr>
                    <td>名:</td>
                    <td th:text="${session.order?.billToFirstName}"></td>
                </tr>
                <tr>
                    <td>姓:</td>
                    <td th:text="${session.order?.billToLastName}"></td>
                </tr>
                <tr>
                    <td>地址一:</td>
                    <td th:text="${session.order?.billAddress1}"></td>
                </tr>
                <tr>
                    <td>地址二:</td>
                    <td th:text="${session.order?.billAddress2}"></td>
                </tr>
                <tr>
                    <td>城市:</td>
                    <td th:text="${session.order?.billCity}"></td>
                </tr>
                <tr>
                    <td>省份:</td>
                    <td th:text="${session.order?.billState}"></td>
                </tr>
                <tr>
                    <td>邮政编码:</td>
                    <td th:text="${session.order?.billZip}"></td>
                </tr>
                <tr>
                    <td>国家:</td>
                    <td th:text="${session.order?.billCountry}"></td>
                </tr>
                <tr>
                    <th colspan="2"><h2>配送信息</h2></th>
                </tr>
                <tr>
                    <td>名:</td>
                    <td th:text="${session.order?.shipToFirstName}"></td>
                </tr>
                <tr>
                    <td>姓:</td>
                    <td th:text="${session.order?.shipToLastName}"></td>
                </tr>
                <tr>
                    <td>地址一:</td>
                    <td th:text="${session.order?.shipAddress1}"></td>
                </tr>
                <tr>
                    <td>地址二:</td>
                    <td th:text="${session.order?.shipAddress2}"></td>
                </tr>
                <tr>
                    <td>城市:</td>
                    <td th:text="${session.order?.shipCity}"></td>
                </tr>
                <tr>
                    <td>省份:</td>
                    <td th:text="${session.order?.shipState}"></td>
                </tr>
                <tr>
                    <td>邮政编码:</td>
                    <td th:text="${session.order?.shipZip}"></td>
                </tr>
                <tr>
                    <td>国家:</td>
                    <td th:text="${session.order?.shipCountry}"></td>
                </tr>
                <tr>
                    <td>快递公司:</td>
                    <td th:text="${session.order?.courier}"></td>
                </tr>
                <tr>
                    <td colspan="2" th:text="'状态:'+${session.order?.status}"> </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <table>
                            <tr>
                                <th>商品编码</th>
                                <th>商品描述</th>
                                <th>数量</th>
                                <th>单价</th>
                                <th>总价</th>
                            </tr>

                            <tr th:each="lineItem:${session.order?.lineItems}">
                                <td>
                                    <a href="viewOrder" th:href="@{viewOrder.html}">
                                    <input type="hidden" name="itemId" th:value="${lineItem.item.itemId}" />
                                    </a>
                                </td>
                                <td>
                                    <a th:if="${lineItem.item != null}" th:text="${lineItem.item.attribute1} + ',' +
                                        ${lineItem.item.attribute2} + ',' + ${lineItem.item.attribute3} + ',' +
                                        ${lineItem.item.attribute4} + ',' + ${lineItem.item.attribute5} + ',' +
                                        ${lineItem.item.product.name}">
                                    </a>
                                    <a th:if="${lineItem.item == null}" th:text="'{description unavailable}'"></a>
                                </td>
                                <td th:text="${lineItem.quantity}"></td>
                                <td th:text="${lineItem.unitPrice}"/></td>
                                <td th:text="${lineItem.total}"/></td>
                            </tr>

                            <tr>
                                <th colspan="5" th:text="'Total:' + ${session.order?.totalPrice}">
                                </th>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </div>
    </div>

    <div th:replace="common/bottom">

    </div>
</body>
</html>